function createXMLHttp() {
	//alert("createXMLHttp");
	var xmlhttp;
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xmlhttp;
}
function ajaxTest() {
	//alert("ajaxTest");
	var xmlhttp = new XMLHttpRequest();
	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	xmlhttp.open("post", "/AjaxDemo/AjaxServlet?username=" + username
			+ "&password=" + password, true);
	xmlhttp.send(null);
	xmlhttp.onreadystatechange = ajaxReady;
}
function ajaxReady() {
	if (this.readyState == 4) {
		if (this.status == 200) {
			//alert("ajaxReady");
			//alert(this.responseXML);
			//this.responseXML.getElementsByTagName("text")[0].firstChild.data
			var type = this.responseXML.getElementsByTagName("text")[0].firstChild.data;
			//alert(type);
			document.getElementById("text1").innerHTML = type;
			document.getElementById("text2").innerHTML = type;
		}
	}
}
